import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XyywCouponAcquireRecordForm, XyywCouponAcquireRecordQuery, XyywCouponAcquireRecordVo } from '@/api/xyyw/model/couponAcquireRecordModel';
import { request } from '@/utils/request';

// 查询用户领取记录列表
export function listCouponAcquireRecord(query?: XyywCouponAcquireRecordQuery) {
  return request.get<TableDataInfo<XyywCouponAcquireRecordVo>>({
    url: '/xyyw/couponAcquireRecord/list',
    params: query,
  });
}

// 查询用户领取记录详细
export function getCouponAcquireRecord(recordId: number) {
  return request.get<R<XyywCouponAcquireRecordVo>>({
    url: `/xyyw/couponAcquireRecord/${recordId}`,
  });
}

// 新增用户领取记录
export function addCouponAcquireRecord(data: XyywCouponAcquireRecordForm) {
  return request.post<R<void>>({
    url: '/xyyw/couponAcquireRecord',
    data,
  });
}

// 修改用户领取记录
export function updateCouponAcquireRecord(data: XyywCouponAcquireRecordForm) {
  return request.put<R<void>>({
    url: '/xyyw/couponAcquireRecord',
    data,
  });
}

// 删除用户领取记录
export function delCouponAcquireRecord(recordIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xyyw/couponAcquireRecord/${recordIds}`,
  });
}
